<?php

require_once 'class.character.php';

class races extends character {
	
	private $raceInfo = array();
	
	public function setRace($id_race) {
		$this -> open();
		$this -> query("SELECT * FROM races WHERE race_id = $id_race");
		
		return $this;
	}
	
	public function getRage() {
		if($this -> numrows > 0)
		{
			$raceInfo = $this -> fetch();
				return $raceInfo;
		} else {
			return FALSE;
		}
	}
	
	public function RaceInfoforChar($id_character) {
		
		$rd = array();
		
		$this -> open();
		$this -> query("SELECT r.race_name AS race_name, r.race_description AS race_description, r.race_image AS race_image" . 
		" FROM characters c LEFT JOIN races r ON c.character_race = r.race_id WHERE c.character_id = $id_character");
		
		if($this -> numrows > 0)
		{
			$rd = $this -> fetch();
		}
		
		return $rd;		 
		
	}
}
		

?>
	